import request from '@/utils/request'

// 创建生产车间
export function createWorkshop(data) {
  return request({
    url: '/base/workshop/create',
    method: 'post',
    data: data
  })
}

// 更新生产车间
export function updateWorkshop(data) {
  return request({
    url: '/base/workshop/update',
    method: 'put',
    data: data
  })
}

// 删除生产车间
export function deleteWorkshop(id) {
  return request({
    url: '/base/workshop/delete?id=' + id,
    method: 'delete'
  })
}

// 获得生产车间
export function getWorkshop(id) {
  return request({
    url: '/base/workshop/get?id=' + id,
    method: 'get'
  })
}

// 获得生产车间简单列表
export function getWorkshopSimple() {
  return request({
    url: '/base/workshop/list-all-simple',
    method: 'get'
  })
}

// 获得生产车间分页
export function getWorkshopPage(query) {
  return request({
    url: '/base/workshop/page',
    method: 'get',
    params: query
  })
}

// 导出生产车间 Excel
export function exportWorkshopExcel(query) {
  return request({
    url: '/base/workshop/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
